<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupParamBox</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	text-decoration: underline;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupParamBox (since 3.19)</h2>

  <p>
  Creates a void
  container for composing elements created using a list of
  <a href="iupparam.html">IupParam</a> elements. Each param is used to create 
  several lines of controls internally arranged in a vertical composition.</p>

  <p>
  It does not have a native representation.</p>

<h3><a name="Creation">Creation</a></h3>
<pre>Ihandle* IupParamBox(Ihandle *<strong>param</strong>, ...); [in C]
Ihandle* IupParamBoxV(Ihandle* <strong>param</strong>, va_list <strong>arglist</strong>); [in C]
Ihandle* IupParamBoxv(Ihandle **<strong>param_array</strong>); [in C]
iup.parambox{<strong>param</strong>, ...: ihandle} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
parambox(<strong>param</strong>, ...) [in LED]</pre>
  <p><strong>param</strong>, ... :
  List of the <strong>IupParam</strong> identifiers that will be used to create 
  the internal controls. NULL must be used to define the end of the list in C. It can 
  NOT be empty. The list of params can NOT be changed after the box is created.</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p> <strong>BUTTON1</strong>, <strong>
BUTTON2</strong>, <strong>BUTTON3</strong> [read-only]: returns an IUP Ihandle* 
of the respective button in the button box.</p>
<p><strong>PARAM<em>n </em></strong>[read-only]: returns an IUP Ihandle* representing the n<sup>th</sup> parameter, indexed 
    by the declaration order, not counting separators or button names. n starts 
at 0.</p>
<p><strong>PARAMCOUNT</strong> [read-only]: returns the number of parameters 
not counting separators and button names.</p>
<p><strong>STATUS</strong> [read-only]: set to 1 when button1 is activated, and set to 0 when button2 is 
activated or the IupGetParam dialog close button is clicked.</p>
<p><strong>LABELALIGN</strong>: controls the alignment of all labels. Can be 
ALEFT or ARIGHT. Default: ALEFT. (since 3.20)</p>
<p><strong>MODIFIABLE</strong>: controls the active state of all controls but 
when disabled allows the text boxes to be read-only and selectable instead of 
inactive. Default: Yes. (since 3.20)</p>

<p><strong>SPINNING</strong>: defined only during the callback to indicate that 
the spin was activated.</p>
<p><strong>USERDATA</strong>: will hold the user data passed to the callback.</p>
<p><a href="../attrib/iup_expand.html">EXPAND</a> (<font SIZE="3">non inheritable*</font>):
  The default value is &quot;YES&quot;. See the documentation of the attribute 
	for EXPAND inheritance.</p>

  <p><b>WID</b> (read-only): returns -1 if mapped.</p>

  <blockquote>
    <hr>
</blockquote>

  <p>
<a href="../attrib/iup_font.html">FONT</a>,
    <a href="../attrib/iup_clientsize.html">CLIENTSIZE</a>, 
	<a href="../attrib/iup_clientoffset.html">CLIENTOFFSET</a>, 
	<a href="../attrib/iup_position.html">POSITION</a>, 
<a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>, <a href="../attrib/iup_theme.html">THEME</a>: 
also accepted.</p>

<h3><a name="Callbacks">Callbacks</a></h3>
<dl>
  <pre>int <strong>PARAM_CB</strong>(Ihandle* <strong>ih</strong>, int <b>param_index, </b>void* <b>user_data</b>); [in C]<br>ih:<strong>param_cb</strong>(<b>param_index</b>: number) -&gt; (ret: number) [in Lua]</pre>
  <p><strong>ih</strong>:
  identifier of the element that activated the 
  event.<br>
  <b>param_index</b>: current parameter being 
    changed. Can have negative values to indicate specific situations: <br>
&nbsp;&nbsp;&nbsp; IUP_GETPARAM_BUTTON1 (-1) = if the user pressed the button 1;<br>
&nbsp;&nbsp;&nbsp; IUP_GETPARAM_INIT&nbsp;(-2)&nbsp; = after the <strong>
  IupGetParam</strong> dialog is mapped and just before it is shown. Not called 
  when <strong>IupParamBox</strong> is directly used;<br>
&nbsp;&nbsp;&nbsp; IUP_GETPARAM_BUTTON2 (-3) = if the user pressed the button 2;<br>
&nbsp;&nbsp;&nbsp; IUP_GETPARAM_BUTTON3 
	(-4) = if the user pressed the button 3, if any;<br>&nbsp;&nbsp;&nbsp; 
  IUP_GETPARAM_CLOSE (-5) = if the user clicked on the <strong>IupGetParam</strong> 
  dialog close button. Not called when <strong>IupParamBox</strong> is directly 
  used; (since 3.13)<br>&nbsp;&nbsp;&nbsp; IUP_GETPARAM_MAP (-5) = before the<strong>
  IupGetParam</strong> dialog is mapped. Not called when <strong>IupParamBox</strong> is directly used; 
  (since 3.21) <br>
  <b>user_data</b>: a user pointer that is passed in the function call.</p>
  <p><span class="style1">Returns:</span> You can reject the change or the 
  button action by returning 0 in the callback, otherwise you must return 1. By 
  default buttons 1 and 2 will return IUP_CLOSE and close any modal dialog. To 
  change that behavior return 0 in the callback. </p>
	<p>You should not programmatically change the current parameter value during the callback. On the other hand you can 
    freely change the value of other parameters.</p>
  <p>Use the attribute &quot;PARAMn&quot; to get the parameter &quot;Ihandle*&quot;, where &quot;n&quot; is the parameter index in the order they are specified starting at 0, but separators 
	and button names are 
    not counted. Notice that this is not the actual control, use the parameter attribute &quot;CONTROL&quot; to get the actual control. For example:</p>
  <pre>Ihandle* param2 = (Ihandle*)IupGetAttribute(ih, &quot;PARAM2&quot;);
int value2 = IupGetInt(param2, IUP_VALUE);

Ihandle* param5 = (Ihandle*)IupGetAttribute(ih, &quot;PARAM5&quot;);
Ihandle* ctrl5 = (Ihandle*)IupGetAttribute(param5, &quot;CONTROL&quot;);

if (value2 == 0)
{
  IupSetAttribute(param5, IUP_VALUE, &quot;New Value&quot;);
  IupSetAttribute(ctrl5, IUP_VALUE, &quot;New Value&quot;);
}</pre>
  <p>Since parameters are user controls and not real controls, you must update the control value and the parameter 
    value.</p>
  <p>Be aware that programmatically changes are not filtered. The valuator, when available, can be retrieved using the 
    parameter attribute &quot;AUXCONTROL&quot;. The valuator is not automatically updated when the text box is 
    changed programmatically. The parameter label is also available using the parameter attribute &quot;LABEL&quot;.</p>
</dl>
<h3>Utilities in Lua</h3>
<p>In Lua, to retrieve a parameter you must use the following function:</p>
<pre>iup.GetParamParam(<strong>ih: </strong>ihandle, <b>index</b><strong>: </strong>number)-&gt; (<b>param</b>: ihandle) [in Lua]
<strong>ih</strong>:GetParamParam(<b>index</b><strong>: </strong>number)-&gt; (<b>param</b>: ihandle)   (since 3.19)</pre>
<p><strong>ih</strong>:
    Identifier of the 
    element. <br>
<strong>index</strong>: parameter to be retrieved.</p>

<h3><a name="Notes">Notes</a></h3>

<p>The box can NOT be dynamically filled using
  <a href="../func/iupappend.html">IupAppend</a> or
<a href="../func/iupinsert.html">IupInsert</a>.</p>

<h3><a name="SeeAlso">See Also</a></h3>

<p><a href="../dlg/iupgetparam.html">IupGetParam</a>, <a href="iupparam.html">
IupParam</a>&nbsp;</p>


</body>

</html>